<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String csspath =  basePath+"WebRoot/WEB-INF/views/";
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<title>axios</title>
</head>
<body>
	<button id="test">点我</button>
    <div id="container"></div>
</body>
<script language="JavaScript">
		/**
		 * axios get请求
		 */
		$("#test").click(function(){
			axios.get('m1',{
				params:{
					name:'duanqf',
					age:'12'
				}
			})
			.then(function(result){
				var data =result.data;
				var container = $("#container");
				container.html("<b>"+data.hello+"</b>");
			})
		});							
	</script>
</html>